﻿using System.Data;
using ET;

namespace DAL
{
    public class MCK_Reason_TimeKeeper_DAL
    {
        private readonly clsConnect cls = new clsConnect();

		#region Getdata
		public DataTable Select_MCK_Reason_TimeKeeper(string keywords)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@KeyWords", keywords);
			return cls.GetData("sp_MCK_Reason_TimeKeeper_Select");
		}
		public DataTable SelectRow_MCK_Reason_TimeKeeper(int id)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@Reason_TimeKeeper_ID", id);
			return cls.GetData("sp_MCK_Reason_TimeKeeper_SelectRow");
		}
		#endregion

		#region Insert
		public bool Insert_MCK_Reason_TimeKeeper(MCK_Reason_TimeKeeper_ET data)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@Enroll_Number", data.Enroll_Number);
			cls.AddParameter("@Date", data.Date);
			cls.AddParameter("@Symbol_TimeKeeper_ID", data.Symbol_TimeKeeper_ID);
			cls.AddParameter("@User_Add", data.User_Add);
			cls.AddParameter("@Date_Add", data.Date_Add);
			cls.AddParameter("@Computer_Add", data.Computer_Add);
			return cls.ExecuteNonQuery("sp_MCK_Reason_TimeKeeper_Insert");
		}
		#endregion

		#region Update
		public bool Update_MCK_Reason_TimeKeeper(MCK_Reason_TimeKeeper_ET data)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@Reason_TimeKeeper_ID", data.Reason_TimeKeeper_ID);
			cls.AddParameter("@Enroll_Number", data.Enroll_Number);
			cls.AddParameter("@Date", data.Date);
			cls.AddParameter("@Symbol_TimeKeeper_ID", data.Symbol_TimeKeeper_ID);
			cls.AddParameter("@User_Modify", data.User_Modify);
			cls.AddParameter("@Date_Modify", data.Date_Modify);
			cls.AddParameter("@Computer_Modify", data.Computer_Modify);
			return cls.ExecuteNonQuery("sp_MCK_Reason_TimeKeeper_Update");
		}
		#endregion

		#region Delete
		public bool Delete_MCK_Reason_TimeKeeper(int id)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@Reason_TimeKeeper_ID", id);
			return cls.ExecuteNonQuery("sp_MCK_Reason_TimeKeeper_Delete");
		}
		#endregion
    }
}